<cfparam name="request.requestState.adminEmail" default="">
<cfparam name="request.requestState.autoStart" default="true">
<cfparam name="request.requestState.allowPublicRSS" default="false">
<cfparam name="request.requestState.autoCreateApplication" default="false">
<cfparam name="request.requestState.autoCreateHost" default="false">
<cfparam name="request.requestState.autoCreateSeverity" default="false">
<cfset adminEmail = request.requestState.adminEmail>
<cfset autoStart = request.requestState.autoStart>
<cfset allowPublicRSS = request.requestState.allowPublicRSS>
<cfset autoCreateApplication = request.requestState.autoCreateApplication>
<cfset autoCreateHost = request.requestState.autoCreateHost>
<cfset autoCreateSeverity = request.requestState.autoCreateSeverity>

<cfoutput>
	<h3>General Settings:</h3>
	
	<div style="margin-left:30px;line-height:24px;">
		<cfif !allowConfigEditing><div style="color:##990000;line-height:18px;font-weight:bold;margin-bottom:10px;">#editingSettingsNotAllowedMsg#</div></cfif>
		<form name="settings" action="index.cfm" method="post">
			<input type="hidden" name="event" value="admin.doSaveGeneralSettings">
			<table>
				<tr valign="top">
					<td>Admin Email:</td>
					<td>
						<input type="text" name="adminEmail" value="#adminEmail#" class="formField" <cfif !allowConfigEditing>disabled</cfif>>
						<div class="formFieldTip">
							This email address is used as the sender address for all emails sent by buglog
						</div>
					</td>
				</tr>
				<tr valign="top">
					<td>Enable Auto-Start:</td>
					<td>
						<input type="radio" name="autoStart" value="true" <cfif autoStart>checked</cfif> <cfif !allowConfigEditing>disabled</cfif>> Yes
						&nbsp;
						<input type="radio" name="autoStart" value="false" <cfif not autoStart>checked</cfif> <cfif !allowConfigEditing>disabled</cfif>> No
						<div class="formFieldTip">
							This setting controls whether the BugLog service will be automatically started when
							a bug report is received, even if the service is not active.<br />
							Disable this setting to completely shut down the service.
						</div>
					</td>
				</tr>
				<tr valign="top">
					<td>Allow Public Access To RSS Feeds:</td>
					<td>
						<input type="radio" name="allowPublicRSS" value="true" <cfif allowPublicRSS>checked</cfif> <cfif !allowConfigEditing>disabled</cfif>> Yes
						&nbsp;
						<input type="radio" name="allowPublicRSS" value="false" <cfif not allowPublicRSS>checked</cfif> <cfif !allowConfigEditing>disabled</cfif>> No
						<div class="formFieldTip">
							This setting controls whether the RSS feeds generated by BugLog are viewable
							by anyone without requiring authentication. When disabled, consumers of the RSS feeds
							must provide a valid username and password to get access.<br><br />
							<span class="label label-important">Warning!</span> <b>Allowing public access to bug reports can be a security risk</b>
						</div>
					</td>
				</tr>
				<tr valign="top">
					<td>Allow Auto-Create:</td>
					<td>
						<input type="checkbox" name="autoCreateApplication" value="true" <cfif autoCreateApplication>checked</cfif>> Applications
						&nbsp;&nbsp;
						<input type="checkbox" name="autoCreateHost" value="true" <cfif autoCreateHost>checked</cfif>> Hosts
						&nbsp;&nbsp;
						<input type="checkbox" name="autoCreateSeverity" value="true" <cfif autoCreateSeverity>checked</cfif>> Severities
						<div class="formFieldTip">
							This setting controls whether to automatically create a new record for each entity type
							when receiving a bug report.
						</div>
					</td>
				</tr>
			</table>
			<br />
			<input type="submit" name="btnSave" value="Apply Changes" <cfif !allowConfigEditing>disabled</cfif>>
		</form>
	</div>
	
</cfoutput>